﻿namespace EasyGo.Data.QueryServices
{
    using System;
    using System.Collections.Generic;
    using System.Dynamic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using EasyGo.Common.Dto;
    using EasyGo.Common.Queries;

    public class TaskQueries : ITaskQueries
    {
        private readonly ApplicationDbContext context;

        public TaskQueries(ApplicationDbContext context)
        {
            this.context = context;
        }

        public IEnumerable<ListTaskDto> GetTasks(int userId)
        {
            return this.context.Tasks.Select(
                     x =>
                     new ListTaskDto()
                         {
                             DueDate = x.DueDate,
                             Id = x.Id,
                             Status = x.Status,
                             Summary = x.Summary,
                             UpdateDate = x.UpdateDate
                         });
        }
    }
}
